<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('category_id')->default(0)->comment('分类id');
            $table->string('goods_name')->default('')->comment('商品名');
            $table->string('goods_thumb')->default('')->comment('商品缩略图');
            $table->decimal('goods_price')->default(0.00)->comment('商品价格');
            $table->bigInteger('sale_num')->default(0)->comment('销量');
            $table->text('detail')->nullable()->comment('商品描述');
            $table->tinyInteger('status')->default(0)->unsigned()->comment('商品状态');
            $table->string('out_url', 2000)->default('')->comment('商品外链');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
